//
//  EmoticonBtns.swift
//  emoticonKB
//
//  Created by mac on 16/3/21.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

class EmoticonBtns: UIButton {

    var emoticon: Emoticons? {
    
        didSet {
        
//            print(emoticon?.imagePath ?? "")
            
            setImage(UIImage(contentsOfFile: emoticon?.imagePath ?? ""), forState: .Normal)
            
            setTitle(emoticon?.codeStr, forState: .Normal)
            
            if let em = emoticon where em.isDelete {
                //删除按钮
                setImage(UIImage(named: "compose_emotion_delete"), forState: .Normal)
            }
        }
    }
}
